﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace JAAF.Builders.Configuration
{
    /// <summary>
    /// Contains information on a concrete implementation of an abstract class or interface.
    /// </summary>
    public class ImplementationRegistration : ConfigurationElement
    {
        [ConfigurationProperty("Abstraction", IsKey = true, IsRequired = true)]
        public string Abstraction
        {
            get
            {
                return (string)this["Abstraction"];
            }
        }

        [ConfigurationProperty("Implementation", IsRequired = true)]
        public string ImplementationTypeName
        {
            get
            {
                return (string)this["Implementation"];
            }
        }

        [ConfigurationProperty("InstancingPolicy", IsRequired=false, DefaultValue=InstancingPolicyEnum.PerCall)]
        public InstancingPolicyEnum InstancingPolicy
        {
            get
            {
                return (InstancingPolicyEnum)this["InstancingPolicy"];
            }
        }
       
        //[ConfigurationProperty("Class", IsRequired = true)]
        //public string Class
        //{
        //    get
        //    {
        //        return (string)this["Class"];
        //    }
        //}

        //[ConfigurationProperty("Assembly", IsRequired = true)]
        //public string Assembly
        //{
        //    get
        //    {
        //        return (string)this["Assembly"];
        //    }

        //}
    
        [ConfigurationProperty("Constructor")]
        [ConfigurationCollection(typeof(ArgumentsCollection))]
        public ArgumentsCollection Constructor
        {
            get
            {
                return (ArgumentsCollection)base["Constructor"];
            }
        }    
    }
}
